<template>
  <div class="engine-config">
    <el-card>
      <template #header>
        <div class="card-header">
          <span>数据处理引擎配置</span>
          <el-button type="primary" @click="showConfigDialog = true">
            <el-icon><Plus /></el-icon>
            新增配置
          </el-button>
        </div>
      </template>

      <el-tabs v-model="activeTab" type="border-card">
        <el-tab-pane label="字段映射" name="fieldMapping">
          <FieldMapping />
        </el-tab-pane>
        <el-tab-pane label="撞库检测" name="collisionCheck">
          <CollisionCheck />
        </el-tab-pane>
        <el-tab-pane label="脚本配置" name="scriptConfig">
          <ScriptConfig />
        </el-tab-pane>
        <el-tab-pane label="验证规则" name="validation">
          <ValidationRules />
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import ValidationRules from './ValidationRules.vue'
import FieldMapping from './FieldMapping.vue'
import CollisionCheck from './CollisionCheck.vue'
import ScriptConfig from './ScriptConfig.vue'

const activeTab = ref('fieldMapping')
const showConfigDialog = ref(false)
</script>

<style scoped>
.engine-config {
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>